import Vue from 'vue'
import VueRouter from 'vue-router'

import UIRouter from '@/first/UIRouter'
import About from '@/first/About'
import Contacts from '@/first/Contacts'

import All from '@/second/All'
import Alice from '@/second/Alice'
import Bob from '@/second/Bob'

import Sina from '@/third/Sina'
import Email from '@/third/Email'
import Blog from '@/third/Blog'
import Phone from '@/third/Phone'

Vue.use(VueRouter)

const router = new VueRouter({
  routes: [
    {
      path: '/',
      redirect:'/uirouter'
    },
    {
      path: '/uirouter',
      component:UIRouter
    },
    {
      path: '/about',
      component:About
    },
    {
      path: '/contacts',
      component: Contacts,
      children: [
        {
          path: 'all',
          component:All
        },
        {
          path: 'alice',
          component: Alice,
          children: [
            {
              path: 'sina',
              component:Sina
            },
            {
              path: 'email',
              component:Email
            }
          ]
        },
        {
          path: 'bob',
          component: Bob,
          children: [
            {
              path: 'phone',
              component:Phone
            },
            {
              path: 'blog',
              component:Blog
            }
          ]
        }
      ]
    }
  ]
})

export default router